<template>
  <view class="prop">
    <!-- 头部 -->
    <uv-status-bar></uv-status-bar>
    <!--自定义头部 -->
    <z-navbar title="我的道具"></z-navbar>
    <view class="prop-content">
      <!-- tab部分 -->
      <view class="prop-content-tabs">
        <view class="prop-content-tabs-list">
          <view class="prop-content-tabs-item" :class="{ itemActive: current === index }" v-for="(item, index) in list" @click="onTabsChange(index)">
            {{ item.name }}
          </view>
          <view class="prop-content-tabs-line" :class="{ left: current === 1 }"></view>
        </view>
      </view>

      <!-- 数据列表部分 -->
      <view class="prop-content-data">
        <activation v-if="current == 0" />
        <notActivation v-else />
      </view>
    </view>
    <uv-safe-bottom></uv-safe-bottom>
  </view>
</template>

<script setup>
  import { onLeft } from '@/common/js/fn';
  import { ref, reactive } from 'vue';
  import activation from './components/activation.vue';
  import notActivation from './components/notActivation.vue';
  let list = ref([{ name: '我的道具' }, { name: '道具店' }]);
  let current = ref(0);

  const onTabsChange = index => {
    current.value = index;
  };
</script>

<style lang="scss" scoped>
  .h-100 {
    height: 100%;
  }
  .prop {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-color: #1d1f24;
    display: flex;
    flex-direction: column;
    &-navbar {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 136rpx;
      position: relative;
      flex-shrink: 0;
      &-arrow {
        position: absolute;
        top: 50%;
        left: 26rpx;
        transform: translate(0, -50%);
        z-index: 999;
        height: 91rpx;
        width: 91rpx;
        box-shadow: 0px 0px 0px 0.2px #aaaaaa;
        background-color: rgba(0, 0, 0, 0.16);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .title {
        font-size: 42rpx;
        color: #fff;
        font-weight: bold;
      }
    }

    &-content {
      padding: 0 26rpx;
      display: flex;
      flex: 1;
      flex-direction: column;
      overflow: hidden;
      &-tabs {
        border-bottom: 1px solid #545454;
        position: relative;
        &-list {
          position: relative;
          margin: 0 120rpx;
          display: flex;
          justify-content: space-between;

          .left {
            left: 62%;
          }
        }
        &-item {
          width: 160rpx;
          text-align: center;
          color: #fff;
          font-size: 28rpx;
          padding: 0 16rpx 9rpx;
          position: relative;
        }
        .itemActive {
          font-size: 28rpx;
          color: #ff7a66;
          font-weight: 700;
        }
        &-line {
          position: absolute;
          left: 3.5%;
          bottom: -3rpx;
          width: 160rpx;
          height: 7rpx;
          background-color: #ff7a66;
          transition: all 0.5s;
        }
      }
      &-data {
        flex: 1;
        overflow: hidden;
      }
    }
  }
</style>
